<%@page import="com.tubeonfire.entity.Tube"%>
<%@page import="com.google.appengine.api.datastore.Text"%>
<%@page import="com.tubeonfire.entity.Playlist"%>
<%	
	Playlist pl = (Playlist)request.getAttribute("result");
	if(pl!=null&&pl.getListTubes().size()>0){
%>
<?xml version="2.0" encoding="utf-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:jwplayer="http://developer.longtailvideo.com/trac/"> 
  <channel> 
<title>Playlist</title> 
	<%		
		for(Text textTube: pl.getListTubes()){
			Tube tub = new Tube();
			tub.transformString(textTube.getValue());
	%>
 	<item> 
	      <title><%=tub.getTitle().getValue() %></title> 
	      <media:content url="http://www.youtube.com/watch?v=<%=tub.getTubeId() %>" /> 
	      <media:thumbnail url="<%=tub.getThumbImageUrl().getValue() %>" />
	      <description><%=tub.getViewCount().getValue() %> views</description>
    </item>		
    <%
		}
    %> 
  </channel> 
</rss>
<%
	}
%>
